package com.au.bescene.activity;

import android.app.Activity;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

import com.au.bescene.R;

/**
 * Represents Venue Screen.
 * @author Khaled
 *
 */
public class Venue extends Activity {
	
	private String _venueName;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.venue);
        
        initializeVenue();
    }
    
    /**
     * Initializes Venue Screen.
     */
    private void initializeVenue() {
		Bundle extras = getIntent().getExtras();
		_venueName = extras.getString("venuename");
		
        Typeface futura = Typeface.createFromAsset(getAssets(), "fonts/futura_lt.ttf");
        
        TextView nameOfVenue = (TextView)findViewById(R.id.venue_nameofvenue);
        nameOfVenue.setTypeface(futura);
        nameOfVenue.setTextSize(17.f);
        nameOfVenue.setTextColor(Color.GRAY);
        
        TextView contactOfVenue = (TextView)findViewById(R.id.venue_contactofvenue);
        contactOfVenue.setTypeface(futura);
        contactOfVenue.setTextSize(17.f);
        contactOfVenue.setTextColor(Color.WHITE);
        
        TextView showOnMap = (TextView)findViewById(R.id.venue_showonmap);
        showOnMap.setTypeface(futura);
        showOnMap.setTextSize(25.f);
        showOnMap.setOnClickListener(_mapListener);
        
        ImageView imageView = (ImageView) findViewById(R.id.venue_venuelogo);
        
        if(_venueName.equals(getResources().getString(R.string.venuelist_bullys))) {
        	nameOfVenue.setText(getResources().getString(R.string.venuelist_bullys));
        	contactOfVenue.setText(getResources().getString(R.string.venuelist_bullys_contact));
        	
			imageView.setImageBitmap(BitmapFactory.decodeResource(getResources(),
					R.drawable.bullys));
        }
        else if(_venueName.equals(getResources().getString(R.string.venuelist_flynns))) {
        	nameOfVenue.setText(getResources().getString(R.string.venuelist_flynns));
        	contactOfVenue.setText(getResources().getString(R.string.venuelist_flynns_contact));
        	
			imageView.setImageBitmap(BitmapFactory.decodeResource(getResources(),
					R.drawable.flynns));
        }
        else if(_venueName.equals(getResources().getString(R.string.venuelist_madcow))){
        	nameOfVenue.setText(getResources().getString(R.string.venuelist_madcow));
        	contactOfVenue.setText(getResources().getString(R.string.venuelist_madcow_contact));
        	
			imageView.setImageBitmap(BitmapFactory.decodeResource(getResources(),
					R.drawable.madcow));
        }
        else if(_venueName.equals(getResources().getString(R.string.venuelist_monsoons))){
        	nameOfVenue.setText(getResources().getString(R.string.venuelist_monsoons));
        	contactOfVenue.setText(getResources().getString(R.string.venuelist_monsoons_contact));
        	
			imageView.setImageBitmap(BitmapFactory.decodeResource(getResources(),
					R.drawable.monsoons));
        }
        else if(_venueName.equals(getResources().getString(R.string.venuelist_riverview))){
        	nameOfVenue.setText(getResources().getString(R.string.venuelist_riverview));
        	contactOfVenue.setText(getResources().getString(R.string.venuelist_riverview_contact));
        	
			imageView.setImageBitmap(BitmapFactory.decodeResource(getResources(),
					R.drawable.riverviewtavern));
        }
        else if(_venueName.equals(getResources().getString(R.string.venuelist_thebank))){
        	nameOfVenue.setText(getResources().getString(R.string.venuelist_thebank));
        	contactOfVenue.setText(getResources().getString(R.string.venuelist_thebank_contact));
        	
			imageView.setImageBitmap(BitmapFactory.decodeResource(getResources(),
					R.drawable.bank));
        }
        else if(_venueName.equals(getResources().getString(R.string.venuelist_thebrewery))){
        	nameOfVenue.setText(getResources().getString(R.string.venuelist_thebrewery));
        	contactOfVenue.setText(getResources().getString(R.string.venuelist_thebrewery_contact));
        	
			imageView.setImageBitmap(BitmapFactory.decodeResource(getResources(),
					R.drawable.brewery));
        }
        else if(_venueName.equals(getResources().getString(R.string.venuelist_theconsortium))){
        	nameOfVenue.setText(getResources().getString(R.string.venuelist_theconsortium));
        	contactOfVenue.setText(getResources().getString(R.string.venuelist_theconsortium_contact));
        	
			imageView.setImageBitmap(BitmapFactory.decodeResource(getResources(),
					R.drawable.consort));
        }
        else if(_venueName.equals(getResources().getString(R.string.venuelist_thewatermark))){
        	nameOfVenue.setText(getResources().getString(R.string.venuelist_thewatermark));
        	contactOfVenue.setText(getResources().getString(R.string.venuelist_thewatermark_contact));
        	
			imageView.setImageBitmap(BitmapFactory.decodeResource(getResources(),
					R.drawable.watermark));
        }   
    }
    
    /**
     * OnClickListener for showing the map.
     */
	private OnClickListener _mapListener = new OnClickListener() {
		public void onClick(View v) {
			if (v.getId() == R.id.venue_showonmap) {
				Intent intent = new Intent(Venue.this, Map.class);
				intent.putExtra("venuename",_venueName);
				startActivity(intent);
			}
		}
	};
}